package top.yudoge.dogeeditor.db;

import cn.hutool.core.util.StrUtil;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ResultSetUtil {
    public static String getStringValue(ResultSet resultSet, String columnName) {

        try {
            String string = resultSet.getString(columnName);
            if (StrUtil.isBlank(string)) {
                return "";
            }
            return string;
        } catch (SQLException e) {
            return "";
        }
    }

    public static Boolean getBooleanValue(ResultSet resultSet, String columnName) {
        try {
            return resultSet.getBoolean(columnName);
        } catch (SQLException e) {
            return false;
        }
    }
}
